package com.rd.student.jiaji.class2.duyukun.Day0724;

import java.util.Scanner;

import static java.util.function.Predicate.isEqual;

public class Exercise {

    //返回两个数字的和
    public static void test1() {
        Scanner scanner = new Scanner(System.in);
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请输入一个数字：");
        int a = scanner.nextInt();
        System.out.println("请再输入一个数字：");
        int b = scanner1.nextInt();
        while (true) {
            int c = a + b;

            System.out.println("它们的和为：" + a + " + " + b + " = " + c);
            return;

        }
    }


    public static void test2() {

        //将分钟转换成秒
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你要转换的时间");
        int min = scanner.nextInt();
        int s = min * 60;

        System.out.println(min + "分钟 = " + s + "秒。");

    }


    public static void test3() {

        //判断数字是否相等
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请再输入一次");
        int num1 = scanner1.nextInt();
        boolean result = (num == num1);
        if (result) {
            System.out.println("ture");
        } else {
            System.out.println("false");
        }
    }


    public static void test4() {
        //判断赞成票和反对票
        Scanner scanner = new Scanner(System.in);
        System.out.println("赞成票数为：");
        int num = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("反对票数为：");
        int num1 = scanner1.nextInt();
        if (num > num1) {
            System.out.println("赞成票多投票通过");
            int last = num - num1;

            System.out.println("赞成票比反对票多：" + last + "票");
        } else if (num == num1) {

            System.out.println("票数相等平票");
        } else if (num < num1) {
            System.out.println("反对票多投票未通过");
            int last1 = num1 - num;

            System.out.println("反对票比赞成票多" + last1 + "飘");
        }
    }


    public static void test5() {
        //求矩形周长
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入矩形的长");
        int length = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请输入矩形的宽");
        int width = scanner1.nextInt();

        int challenge = (length + width) * 2;
        System.out.println("长为：" + length + " 宽为：" + width + " 的矩形周长为：" + challenge);
    }


    public static void test6() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三角形的最长一条边");
        int length = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请输入三角形的第二条边");
        int width = scanner1.nextInt();
        int sum = length + width;
        int differ = length - width;

        System.out.println("第三边的范围是： 大于" + differ + " 小于" + sum);


    }

    public static void test7() {

        //对数字取余
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int length = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请输入在输入一个数字");
        int width = scanner1.nextInt();
        int rem = length % width;

        System.out.println("余数为： " + rem);

    }


    public static void main(String[] args) {
        //test1();
        //test2();
        //test3();
        //test3();
        //test4();
        //test5();
        //test6();
        test7();



    }
}
